/////////////////////////////////////////////////////////////////////////////////////////////
// Filename: AppOwnedStates.cpp
// (c) Dave Ottley, 2012. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////
//		INCLUDES
///////////////////////////
#include <Windows.h>
#include <assert.h>

///////////////////////////
//		MY INCLUDES
///////////////////////////
#include "AppOwnedStates.h"
#include "ApplicationMessages.h"
#include "ApplicationLayer.h"

//------------------------------------------------------methods for MainMenuPlayState
MainMenuPlayState * MainMenuPlayState::GetInstance()
{
	static MainMenuPlayState theOne;

	return &theOne;
}

void MainMenuPlayState::Enter( ApplicationLayer * application)
{
	//...
}

void MainMenuPlayState::Execute( ApplicationLayer * application)
{
	   
	//InputCls->PollForInput(Input);
	//UpdateOpeningAnimation();
	//PlayIntroMusic();

}

void MainMenuPlayState::Exit( ApplicationLayer * application)
{
	//...
}

bool MainMenuPlayState::OnMessage( ApplicationLayer * application, const Telegram& msg)
{
	switch(msg.Msg)
	{
	case ApplicationMsg::PauseRequest:		// 4000
		application->Pause();
		return true;

	case ApplicationMsg::UnpauseRequest:	// 4001
		application->Unpause();
		return true;

	case ApplicationMsg::RequestNumPlayers:	// 4002
		{
			PlayerCount * temp = (PlayerCount *) msg.ExtraInfo;
			(*temp) = application->GetNumPlayers();
			return true;
		}

	default:
		assert(false && "<MainMenuPlaySttate::OnMessage> The application has received a message it does not understand.");
		return false;
	}
}

//------------------------------------------------------methods for MainMenuCreditsState
MainMenuCreditsState * MainMenuCreditsState::GetInstance()
{
	static MainMenuCreditsState theOne;

	return &theOne;
}

void MainMenuCreditsState::Enter( ApplicationLayer * application)
{
	//...
}

void MainMenuCreditsState::Execute( ApplicationLayer * application)
{
	//...
}

void MainMenuCreditsState::Exit( ApplicationLayer * application)
{
	//...
}

bool MainMenuCreditsState::OnMessage( ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for MainMenuQuitState
MainMenuQuitState * MainMenuQuitState::GetInstance()
{
	static MainMenuQuitState theOne;

	return &theOne;
}

void MainMenuQuitState::Enter( ApplicationLayer * application)
{
	//...
}

void MainMenuQuitState::Execute( ApplicationLayer * application)
{
	//...
}

void MainMenuQuitState::Exit( ApplicationLayer * application)
{
	//...
}

bool MainMenuQuitState::OnMessage( ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for CreditsState
CreditsState * CreditsState::GetInstance()
{
	static CreditsState theOne;

	return &theOne;
}

void CreditsState::Enter( ApplicationLayer * application)
{
	//...
}

void CreditsState::Execute( ApplicationLayer * application)
{
	//...
}

void CreditsState::Exit( ApplicationLayer * application)
{
	//...
}

bool CreditsState::OnMessage( ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for QuitState
QuitState * QuitState::GetInstance()
{
	static QuitState theOne;

	return &theOne;
}

void QuitState::Enter( ApplicationLayer * application)
{
	//...
}

void QuitState::Execute( ApplicationLayer * application)
{
	//...
}

void QuitState::Exit( ApplicationLayer * application)
{
	//...
}

bool QuitState::OnMessage( ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for PausedState
PausedState * PausedState::GetInstance()
{
	static PausedState theOne;

	return &theOne;
}

void PausedState::Enter( ApplicationLayer * application)
{
	//...
}

void PausedState::Execute( ApplicationLayer * application)
{
	Sleep(100);
}

void PausedState::Exit( ApplicationLayer * application)
{
	//...
}

bool PausedState::OnMessage( ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for GameplayLevelStartupState
GameplayLevelStartupState * GameplayLevelStartupState::GetInstance()
{
	static GameplayLevelStartupState theOne;

	return &theOne;
}

void GameplayLevelStartupState::Enter(ApplicationLayer * application)
{
	//...
}

void GameplayLevelStartupState::Execute(ApplicationLayer * application)
{
	//...
}

void GameplayLevelStartupState::Exit(ApplicationLayer * application)
{
	//...
}

bool GameplayLevelStartupState::OnMessage(ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for GameplayPlayState
GameplayPlayState * GameplayPlayState::GetInstance()
{
	static GameplayPlayState theOne;

	return &theOne;
}

void GameplayPlayState::Enter(ApplicationLayer * application)
{
	//...
}

void GameplayPlayState::Execute(ApplicationLayer * application)
{
	//...
}

void GameplayPlayState::Exit(ApplicationLayer * application)
{
	//...
}

bool GameplayPlayState::OnMessage(ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for GameplayLevelCompleteState
GameplayLevelCompleteState * GameplayLevelCompleteState::GetInstance()
{
	static GameplayLevelCompleteState theOne;

	return &theOne;
}

void GameplayLevelCompleteState::Enter(ApplicationLayer * application)
{
	//...
}

void GameplayLevelCompleteState::Execute(ApplicationLayer * application)
{
	//...
}

void GameplayLevelCompleteState::Exit(ApplicationLayer * application)
{
	//...
}

bool GameplayLevelCompleteState::OnMessage(ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for GameplayDeadState
GameplayDeadState * GameplayDeadState::GetInstance()
{
	static GameplayDeadState theOne;

	return &theOne;
}

void GameplayDeadState::Enter(ApplicationLayer * application)
{
	//...
}

void GameplayDeadState::Execute(ApplicationLayer * application)
{
	//...
}

void GameplayDeadState::Exit(ApplicationLayer * application)
{
	//...
}

bool GameplayDeadState::OnMessage(ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for GameOverState
GameOverState * GameOverState::GetInstance()
{
	static GameOverState theOne;

	return &theOne;
}

void GameOverState::Enter(ApplicationLayer * application)
{
	//...
}

void GameOverState::Execute(ApplicationLayer * application)
{
	//...
}

void GameOverState::Exit(ApplicationLayer * application)
{
	//...
}

bool GameOverState::OnMessage(ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for GameCompleteState
GameCompleteState * GameCompleteState::GetInstance()
{
	static GameCompleteState theOne;

	return &theOne;
}

void GameCompleteState::Enter(ApplicationLayer * application)
{
	//...
}

void GameCompleteState::Execute(ApplicationLayer * application)
{
	//...
}

void GameCompleteState::Exit(ApplicationLayer * application)
{
	//...
}

bool GameCompleteState::OnMessage(ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}

//------------------------------------------------------methods for ApplicationGlobalState
ApplicationGlobalState * ApplicationGlobalState::GetInstance()
{
	static ApplicationGlobalState theOne;

	return &theOne;
}

void ApplicationGlobalState::Enter(ApplicationLayer * application)
{
	//...
}

void ApplicationGlobalState::Execute(ApplicationLayer * application)
{
	//...
}

void ApplicationGlobalState::Exit(ApplicationLayer * application)
{
	//...
}

bool ApplicationGlobalState::OnMessage(ApplicationLayer * application, const Telegram& msg)
{
	//...
	return true;
}